package com.kakarote.examine.constant;

import com.kakarote.core.common.enums.SystemCodeEnum;
import com.kakarote.core.exception.CrmException;

import java.util.Objects;

//读取结果方式
public enum ReadFlagEnum {


    //未读
    UNREAD(1, "未读"),
    //已读
    READ(2, "已读"),
    ;

    private ReadFlagEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    private Integer type;
    private String desc;

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static ReadFlagEnum valueOf(Integer type) {
        for (ReadFlagEnum handleTypeEnum : values()) {
            if (Objects.equals(type, handleTypeEnum.getType())) {
                return handleTypeEnum;
            }
        }
        throw new CrmException(SystemCodeEnum.SYSTEM_NO_VALID);
    }

}
